#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(void){
    int t;
    ll n;
    scanf("%d",&t);
    int c=1;
    while(t--){
        ll ans=0;
        scanf("%lld",&n);
        //先求出因数和为奇数的个数
        for(ll i=1;i*i<=n;i++){
            ans++;
            if(2*i*i<=n){
                ans++;
            }
        }
        printf("Case %d: %lld\n",c++,n-ans);
    }
    return 0;
}
